#include<bits/stdc++.h>
#define double long double
using namespace std;
int n;
double ansx=0,ansy=0,ans;
struct ok{
	double t1,t2,t3,t4,k,b,invk;
	int F;
}a[105];
inline double check(double x){
	if(x<0.0) return -x;
	return x; 
}
inline double dis(double x,double y,int id){
	if(a[id].F==1){
		if(a[id].t2<=y&&y<=a[id].t4) return check(x-a[id].t1);
		else if(y<a[id].t2) return sqrt((x-a[id].t1)*(x-a[id].t1)+(y-a[id].t2)*(y-a[id].t2));
		else return sqrt((x-a[id].t3)*(x-a[id].t3)+(y-a[id].t4)*(y-a[id].t4));
	}
	else if(a[id].F==2){
		if(a[id].t1<=x&&x<=a[id].t3) return check(y-a[id].t2);
		else if(x<a[id].t1) return sqrt((x-a[id].t1)*(x-a[id].t1)+(y-a[id].t2)*(y-a[id].t2));
		else return sqrt((x-a[id].t3)*(x-a[id].t3)+(y-a[id].t4)*(y-a[id].t4));
	}
	else{
		double invb=y-a[id].invk*x;
		double X=(invb-a[id].b)/(a[id].k-a[id].invk);
		double Y=X*a[id].k+a[id].b;
		if(a[id].t1<=X&&X<=a[id].t3) return sqrt((x-X)*(x-X)+(y-Y)*(y-Y));
		else if(X<a[id].t1) return sqrt((x-a[id].t1)*(x-a[id].t1)+(y-a[id].t2)*(y-a[id].t2));
		else return sqrt((x-a[id].t3)*(x-a[id].t3)+(y-a[id].t4)*(y-a[id].t4));
	}
}
inline double js(double x,double y){
	double z=0;
	for(int i=1;i<=n;i++) z=max(z,dis(x,y,i));
	return z;
}
inline void SA(){
	for(double T=5000.0;T>1e-15;T*=0.996){
		double X=ansx+((double)rand()*2.0-(double)RAND_MAX)*T;
		double Y=ansy+((double)rand()*2.0-(double)RAND_MAX)*T;
		double w=js(X,Y);
		double s=w-ans;
		if(s<0){
			ansx=X;ansy=Y;
			ans=w;
		}
		else if(exp(-s/T)*RAND_MAX>rand()){
			ansx=X;ansy=Y;
		}
	}
}
signed main(){
	srand(114514);
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i].t1>>a[i].t2>>a[i].t3>>a[i].t4;
		if(a[i].t1>a[i].t3) swap(a[i].t1,a[i].t3),swap(a[i].t2,a[i].t4);
		else if(a[i].t1==a[i].t3&&a[i].t2>a[i].t4) swap(a[i].t2,a[i].t4);
		if(a[i].t1==a[i].t3) a[i].F=1;
		else if(a[i].t2==a[i].t4) a[i].F=2;
		else{
			a[i].F=0;
			a[i].k=(a[i].t4-a[i].t2)/(a[i].t3-a[i].t1);
			a[i].b=a[i].t2-a[i].t1*a[i].k;
			a[i].invk=-(double)1.0/a[i].k;
		}
	}
	ans=js(ansx,ansy);
	for(int i=1;i<=100;i++) SA();
	cout<<fixed<<setprecision(10)<<ans;
	return 0;
}